//- Copyright (c) 2016 Lucky Byte, Inc.
mixin limit(limits)
  td.collapsing.right.aligned
    | 交易时间
  td.positive.collapsing
    = limits.time_begin ? limits.time_begin : '不限'
    |  - 
    = limits.time_end ? limits.time_end : '不限'
  td.collapsing.right.aligned
    | 单笔限额
  td.positive.collapsing
    = limits.min_amt_per > 0.0 ? fmtamt(limits.min_amt_per) : '不限额'
    |  - 
    = limits.max_amt_per > 0.0 ? fmtamt(limits.max_amt_per) : '不限额'
  td.collapsing.right.aligned
    | 分钟限额／限笔
  td.positive.collapsing
    = limits.max_amt_minute > 0 ? fmtamt(limits.max_amt_minute) : '不限额'
    |  ／ 
    = limits.max_cnt_minute > 0 ? limits.max_cnt_minute : '不限笔'
  td.collapsing.right.aligned
    | 单日限额／限笔
  td.positive
    = limits.max_amt_day > 0 ? fmtamt(limits.max_amt_day) : '不限额'
    |  ／ 
    = limits.max_cnt_day > 0 ? limits.max_cnt_day : '不限笔'

table.ui.celled.small.compact.table.very.basic.structured.nolayout
  tbody
    tr
      td.right.aligned.collapsing 交易权限
      - var text = ''
      - for (var k in record.trctl.trcodes)
        - text += constant.trctl_codes[k] + "、"
      td.positive(colspan="8")= text.substring(0, text.length - 1)
    tr
      td.right.aligned.collapsing 消费交易
      if record.trctl.t20
        +limit(record.trctl.t20)
    tr
      td.right.aligned.collapsing 助农取款
      if record.trctl.t60
        +limit(record.trctl.t60)
    tr
      td.right.aligned.collapsing 商户代付
      if record.trctl.tz0
        +limit(record.trctl.tz0)
    tr
      td.right.aligned.collapsing 备 注
      td.positive(colspan="8")= record.notes
